<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/2/23
 * Time: 15:25
 */?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我的主页面</title>
    <style>
        body{ background:url("imag/3.jpg");}
        .admin {font-size:25px;
            font-family: 华文行楷;}
    </style>
</head>

<body>
<div class="admin">
    <table >
        <tr><td><a href="login.html">关于本系统</a></td>
            <td><a href="register.html">下机</a></td>
            <td><a href="login.php">退出界面</a></td>
            <td><a href="register.html">修改密码</a></td>
        </tr>
    </table>
</div>
</body>
</html>
<?php
echo "今天是 " . date("Y-m-d") . "<br>";
echo "今天是 " . date("l"). "<br>";

date_default_timezone_set("Asia/Shanghai");
echo "当前时间是 " . date("h:i:sa") ."<br>";
date_default_timezone_set('Asia/Hong_Kong');
$startTime = '09:00:00';
$endTime = '18:00:00';
// 将时间转化为unix时间戳
$startTimeStr = strtotime($startTime);
$endTimeStr = strtotime($endTime);
$total = $endTimeStr - $startTimeStr;
$restHours = 1;
// 休息1小时
 $now = strtotime(date('H:i:s'));
$remain = $endTimeStr - $now;
echo '上机时间：'.($total/3600-$restHours).'小时<br>';
echo '还有：'.floor(($remain/3600)).'小时'.floor($remain/60).'分钟下机';

?>


